package com.wesley.decorator;

/**
 * <h1>装饰者</h1>
 * <p>详述</p>
 *
 * @Date: 2021/8/18
 */
public class Decorator extends Drink{

    private Drink drink;

    @Override
    public float cost() {
        return drink.cost() + super.getPrice();
    }

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public String getDesc() {
        return super.desc + " " + super.getPrice() + " & " + drink.getDesc();
    }
}
